package com.lrs.java.j2se_self.net;
import java.net.*;
import java.io.*;
public class TestTCPServer {
	public static void main(String[] args) throws Exception {
		ServerSocket ss = new ServerSocket(8888);
		while(true){
			Socket s = ss.accept();
			DataInputStream dis = new DataInputStream(s.getInputStream());
			System.out.println(dis.readUTF());
			//System.out.println("a socket collected!");
			dis.close();
			s.close();
		}
		
	}
}
